//
//  ViewController.m
//  UI_QQmusic
//
//  Created by dllo on 16/7/19.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
      [super viewDidLoad];
      
      UIImageView *image = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"6PS5J4FQQEK7_1000x500"]];
      [self.view addSubview:image];
      image.frame = [UIScreen mainScreen].bounds;
      UIButton *button = [[UIButton alloc]initWithFrame:CGRectMake(10, 19, 50, 50)];
      [self.view addSubview:button];
      [button setImage:[UIImage imageNamed:@"miniplayer_btn_playlist_close"] forState:UIControlStateNormal];
  //三个点
      UIPageControl *page = [[UIPageControl alloc]initWithFrame:CGRectMake(350, 19, 50, 50)];
      [self.view addSubview:page];
      page.numberOfPages = 3;
      page.currentPage = 1;
      page.currentPageIndicatorTintColor = [UIColor whiteColor];
      page.pageIndicatorTintColor = [UIColor grayColor];
      //MV
      UIImageView *imageMV = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"cell_mv_icon-1"]];
      [self.view addSubview:imageMV];
      imageMV.frame = CGRectMake(156, 107, 46, 20);
      //dts
      UIImageView *imagedts = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"player_btn_dts_on_pressed"]];
      [self.view addSubview:imagedts];
      imagedts.frame = CGRectMake(213, 107, 46, 20);
      //标题
      UILabel *labellove = [[UILabel alloc]initWithFrame:CGRectMake(166, 24, 100, 40)];
      [self.view addSubview:labellove];
      labellove.text = @"爱情悬崖";
      labellove.textColor = [UIColor whiteColor];
      labellove.font = [UIFont systemFontOfSize:20];
      UILabel *labelJay = [[UILabel alloc]initWithFrame:CGRectMake(156, 60, 100, 40)];
      [self.view addSubview:labelJay];
      labelJay.text = @"一 周杰伦 一";
      labelJay.font = [UIFont systemFontOfSize:17];
      labelJay.textColor = [UIColor whiteColor];
      UILabel *labelquan = [[UILabel alloc]initWithFrame:CGRectMake(138, 470, 150, 40)];
      [self.view addSubview:labelquan];
      labelquan.text = @"爱情悬崖 - 周杰伦";
      labelquan.textColor = [UIColor colorWithRed:78/255.0f green:185/255.0f blue:95/255.0f alpha:1];
      labelquan.font = [UIFont systemFontOfSize:17];
      UIPageControl *pagenext = [[UIPageControl alloc]initWithFrame:CGRectMake(180, 506, 50, 50)];
      [self.view addSubview:pagenext];
      pagenext.numberOfPages = 3;
      pagenext.currentPageIndicatorTintColor = [UIColor whiteColor];
      pagenext.pageIndicatorTintColor = [UIColor grayColor];
      pagenext.currentPage = 1;
      UILabel *labeltimeleft = [[UILabel alloc]initWithFrame:CGRectMake(15, 538, 60, 40)];
      [self.view addSubview:labeltimeleft];
      labeltimeleft.text = @"03:28";
      labeltimeleft.textColor = [UIColor grayColor];
      labeltimeleft.font = [UIFont systemFontOfSize:15];
      UILabel *labeltimeright = [[UILabel alloc]initWithFrame:CGRectMake(356, 538, 60, 40)];
      [self.view addSubview:labeltimeright];
      labeltimeright.text = @"04:22";
      labeltimeright.textColor = [UIColor grayColor];
      labeltimeright.font = [UIFont systemFontOfSize:15];
      //音量滑块
      UISlider *sli = [[UISlider alloc]initWithFrame:CGRectMake(60, 550, 285, 20)];
      [self.view addSubview:sli];
      //设置右边图片
      
      [sli setMaximumTrackImage:[UIImage imageNamed:@"player_slider_playback_right"] forState:UIControlStateNormal];
      //设置左边图片
      [sli setMinimumTrackImage:[UIImage imageNamed:@"player_slider_playback_left"] forState:UIControlStateNormal];
      
      [sli setThumbImage:[UIImage imageNamed:@"player_slider_playback_thumb"] forState:UIControlStateNormal];
      sli.maximumTrackTintColor = [UIColor grayColor];
      [sli addTarget:self action:@selector(sliderValueChanged:) forControlEvents:UIControlEventValueChanged];
      
      //上一首
      UIButton *buttonleft = [[UIButton alloc]initWithFrame:CGRectMake(90, 607, 45, 45)];
      [self.view addSubview:buttonleft];
      [buttonleft setImage:[UIImage imageNamed:@"Unknown"] forState:UIControlStateNormal];
      UIButton *buttonright = [[UIButton alloc]initWithFrame:CGRectMake(280, 607, 45, 45)];
      [self.view addSubview:buttonright];
      [buttonright setImage:[UIImage imageNamed:@"Unknown-1"] forState:UIControlStateNormal];
      UIButton *buttonplay = [[UIButton alloc]initWithFrame:CGRectMake(170, 592, 76, 76)];
      [self.view addSubview:buttonplay];
      [buttonplay setImage:[UIImage imageNamed:@"Unknown-2"] forState:UIControlStateNormal];
      [buttonplay addTarget:self action:@selector(buttonplay:) forControlEvents:UIControlEventTouchUpInside];
      
      UIButton *buttonheart = [[UIButton alloc]initWithFrame:CGRectMake(27, 665, 60, 60)];
      [self.view addSubview:buttonheart];
      [buttonheart setImage:[UIImage imageNamed:@"Unknown-3"] forState:UIControlStateNormal];
      UIButton *buttonloop = [[UIButton alloc]initWithFrame:CGRectMake(102, 665, 60, 60)];
      [self.view addSubview:buttonloop];
      [buttonloop setImage:[UIImage imageNamed:@"Unknown-4"] forState:UIControlStateNormal];
      UIButton *buttondown = [[UIButton alloc]initWithFrame:CGRectMake(177, 665, 60, 60)];
      [self.view addSubview:buttondown];
      [buttondown setImage:[UIImage imageNamed:@"Unknown-5"] forState:UIControlStateNormal];
      UIButton *buttonshare = [[UIButton alloc]initWithFrame:CGRectMake(252, 665, 60, 60)];
      [self.view addSubview:buttonshare];
      [buttonshare setImage:[UIImage imageNamed:@"Unknown-6"] forState:UIControlStateNormal];
      UIButton *buttonmore = [[UIButton alloc]initWithFrame:CGRectMake(327, 665, 60, 60)];
      [self.view addSubview:buttonmore];
      [buttonmore setImage:[UIImage imageNamed:@"Unknown-7"] forState:UIControlStateNormal];
      UIImageView *imageyuanpan = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"E265DF826B794F0A3D3F136622E2B4F3-1"]];
      [self.view addSubview:imageyuanpan];
      imageyuanpan.frame = CGRectMake(58, 150, 300, 300);
      
}

//滑块方法
- (void)sliderValueChanged:(id)sender {
     
      

}
- (void)buttonplay:(UIButton *)playbutton {
      [playbutton removeTarget:self action:@selector(buttonplay:) forControlEvents:UIControlEventTouchUpInside];
      [playbutton addTarget:self action:@selector(pasueSong:) forControlEvents:UIControlEventTouchUpInside];
      [playbutton setImage:[UIImage imageNamed:@"Unknown-8"] forState:UIControlStateNormal];

}

- (void)pasueSong:(UIButton *)pasueSong {
      [pasueSong removeTarget:self action:@selector(pasueSong:) forControlEvents:UIControlEventTouchUpInside];
      [pasueSong addTarget:self action:@selector(buttonplay:) forControlEvents:UIControlEventTouchUpInside];
      [pasueSong setImage:[UIImage imageNamed:@"Unknown-2"] forState:UIControlStateNormal];
      

}

@end
